From bd16e616b68c525fe9dcd76532148a8f4d5fbaad Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 26 Jul 2005 16:16:39 +0000 Subject: [PATCH] Attached patch removes the empty domain if xc.memory_increase_reservation fails. Signed-off-by: Anthony Liguori --- tools/python/xen/xend/image.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index 82b20a0295..95d29c642a 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -130,7 +130,13 @@ class ImageHandler: # xc.domain_setuuid(dom, uuid) xc.domain_setcpuweight(dom, cpu_weight) xc.domain_setmaxmem(dom, mem_kb) - xc.domain_memory_increase_reservation(dom, mem_kb) + + try: + xc.domain_memory_increase_reservation(dom, mem_kb) + except: + xc.domain_destroy(dom) + raise + if cpu != -1: xc.domain_pincpu(dom, 0, 1<